/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.amqp.rabbitmq.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 用于指定RoutingKey。方法第一个参数为message(消息体)。第二个参数delaySeconds，消息在Queue中的存续时间，通常应用场景为死信队列，做延时消息。示例：
 *
 * <pre>
 * &#64;RoutingKey("test")
 * public void send(Object message, int delaySeconds);
 *
 * &#64;RoutingKey("test.*")
 * public void send(Object message);
 * </pre>
 *
 * @auther ebert_chan
 */
@Target(value = {ElementType.METHOD})
@Retention(value = RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface RoutingKey {

    /**
     * routingKey
     *
     * @return
     * @auther ebert_chan
     */
    String value();

    /**
     * exchange，默认为空，为空时读取类上@RabbitProducer定义的exchange
     *
     * @return
     * @auther ebert_chan
     */
    String exchange() default "";

}
